package com.libre.seal;

import java.util.UUID;

/**
 * <b> 提示：要生成长方形印章，可以参考下，主要在Seal中的方法里。
 * </b><br><br><i>Description</i> :
 * <br><br>Date: 2019/12/26 ${time}    <br>Author : dxl
 */
public class SealUtils {


    private static String path = System.getProperty("user.dir")+"\\src\\main\\resources\\seal\\";

    public static String OfficialSeal_1(String content) throws Exception {
        String filename = UUID.randomUUID().toString().replace("-", "") + ".png";
        Seal.builder()
                .size(200)
                .borderCircle(SealCircle.builder().line(4).width(95).height(95).build())
                .mainFont(SealFont.builder().text(content).family("隶书").size(22).space(22.0).margin(4).build())
                .centerFont(SealFont.builder().text("★").size(60).build())
                .titleFont(SealFont.builder().text("电子签章").size(16).space(8.0).margin(54).build())
                .build()
                .draw(path+filename);
        return "file:///"+path+filename;
    }

    public static String OfficialSeal_2(String content) throws Exception {
        String filename = UUID.randomUUID().toString().replace("-", "") + ".png";
        Seal.builder()
                .size(300)
                .borderCircle(SealCircle.builder().line(5).width(140).height(140).build())
                .mainFont(SealFont.builder().text(content).size(35).space(35.0).margin(10).build())
                .centerFont(SealFont.builder().text("★").size(100).build())
                .titleFont(SealFont.builder().text("电子签章").size(22).space(10.0).margin(68).build())
                .build()
                .draw(path+filename);
        return "file:///"+path+filename;
    }

    public static String OfficialSeal_3(String content) throws Exception {
        String filename = UUID.randomUUID().toString().replace("-", "") + ".png";
        Seal.builder()
                .size(300)
                .borderCircle(SealCircle.builder().line(3).width(144).height(100).build())
                .borderInnerCircle(SealCircle.builder().line(1).width(140).height(96).build())
                .mainFont(SealFont.builder().text(content).size(25).space(12.0).margin(10).build())
                .centerFont(SealFont.builder().text("NO.5201314").size(20).build())
                .titleFont(SealFont.builder().text("电子合同专用章").size(20).space(9.0).margin(64).build())
                .build()
                .draw(path+filename);
        return "file:///"+path+filename;
    }

    public static String PrivateSeal_1(String content) throws Exception {
        String filename = UUID.randomUUID().toString().replace("-", "") + ".png";
        Seal.builder()
                .size(300)
                .borderSquare(16)
                .mainFont(SealFont.builder().text(content).size(120).build())
                .build()
                .draw(path+filename);
        return "file:///"+path+filename;
    }

    public static String PrivateSeal_2(String content) throws Exception {
        String filename = UUID.randomUUID().toString().replace("-", "") + ".png";
        Seal.builder()
                .size(300)
                .borderSquare(16)
                .mainFont(SealFont.builder().text(content).size(120).build())
                .build()
                .draw(path+filename);
        return "file:///"+path+filename;
    }
}
